import 'dart:async';

import 'package:flutter_cost/app/config/route_jump.dart';
import 'package:get/get.dart';

import 'state.dart';

class SplashLogic extends GetxController {
  final SplashState state = SplashState();
  late Timer _timer;

  @override
  void onInit() {
    super.onInit();

    var duration = const Duration(milliseconds: 3000);
    _timer = Timer.periodic(duration, (timer) {
      _timer.cancel();
      jump2Main();
    });
  }

  @override
  void onClose() {
    super.onClose();
    _timer.cancel();
  }
}
